]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
inputMethod: Do not change IBus.Capabilite by focus events
authorTakao Fujiwara <tfujiwar@redhat.com>
Tue, 1 Oct 2019 10:53:20 +0000 (19:53 +0900)
committerCarlos Garnacho <mrgarnacho@gmail.com>
Wed, 2 Oct 2019 08:40:27 +0000 (08:40 +0000)
gnome-shell calls ibus_input_context_focus_in() in InputMethod.focus_in()
but the event is not actually forwarded to panels and engines in GNOME
Wayland because gnome-shell changes IBus.Capabilite by focus events and
disables IBus.Capabilite.FOCUS when ibus_input_context_focus_in() is called.

IBus.Capabilite is assumed a fixed value per input context in the
first place and it should not be changed by focus events.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/573

js/misc/inputMethod.js

index 811ba55fd20e8108f0b3a36c70f2f11ad69c4403..1ca70c3df549db8e5e3b2f7269f63eaccfaeabe9 100644 (file)
@@ -36,15 +36,7 @@ class InputMethod extends Clutter.InputMethod {
     }
 
     _updateCapabilities() {
-        let caps = 0;
-
-        if (this.can_show_preedit)
-            caps |= IBus.Capabilite.PREEDIT_TEXT;
-
-        if (this._currentFocus)
-            caps |= IBus.Capabilite.FOCUS | IBus.Capabilite.SURROUNDING_TEXT;
-        else
-            caps |= IBus.Capabilite.PREEDIT_TEXT | IBus.Capabilite.AUXILIARY_TEXT | IBus.Capabilite.LOOKUP_TABLE | IBus.Capabilite.PROPERTY;
+        let caps = IBus.Capabilite.PREEDIT_TEXT | IBus.Capabilite.FOCUS | IBus.Capabilite.SURROUNDING_TEXT;
 
         if (this._context)
             this._context.set_capabilities(caps);
@@ -137,7 +129,6 @@ class InputMethod extends Clutter.InputMethod {
         this._currentFocus = focus;
         if (this._context) {
             this._context.focus_in();
-            this._updateCapabilities();
             this._emitRequestSurrounding();
         }
 
@@ -149,10 +140,8 @@ class InputMethod extends Clutter.InputMethod {
 
     vfunc_focus_out() {
         this._currentFocus = null;
-        if (this._context) {
+        if (this._context)
             this._context.focus_out();
-            this._updateCapabilities();
-        }
 
         if (this._preeditStr) {
             // Unset any preedit text